#include "../include/BankAccount.h"
#include <iostream>

BankAccount::BankAccount(int newId, double firstYitra): _id(new int (newId)), _yitra(new double(firstYitra)), _yesterday(new double(firstYitra)){
	}

	void BankAccount::changeYitra(double change){
		*_yitra = *_yitra + change;
	}

	double BankAccount::calcProfit(){
		return (*_yitra - *_yesterday);
	}


	double& BankAccount::getYitra(){return *_yitra;}

	void BankAccount::endOfDay(){
		*_yesterday = *_yitra;
	}

	BankAccount::~BankAccount(){
		delete _id;
		delete _yitra;
		delete _yesterday;
	}
